package cn.uestc.labhms.modules.hms.controller;

import cn.uestc.labhms.common.annotation.SysLog;
import cn.uestc.labhms.common.utils.R;
import cn.uestc.labhms.modules.hms.service.ConditionFindService;
import cn.uestc.labhms.modules.hms.util.HMSPageUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author Mu.tz
 */
@RestController
public class ConditionFindController {
    @Autowired
    private ConditionFindService conditionFindService;

    @GetMapping("/get/condition/tables")
    @SysLog("条件查询")
    public R conditionFind(@RequestParam("keys") List<String> keys, @RequestParam("vals") List<String> vals, @RequestParam(value = "curPage", required = false) Integer curPage) {
        List<HMSPageUtils> conditionTables = conditionFindService.getConditionTables(keys, vals, curPage);
        return R.ok().put("data", conditionTables);
    }
}
